package com.wjl.picture.user.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wjl.picture.user.model.entity.User;
import com.wjl.picture.user.model.request.UserQueryRequest;
import com.wjl.picture.user.model.vo.UserLoginVO;
import com.wjl.picture.user.model.vo.UserVO;
import me.chanjar.weixin.common.bean.WxOAuth2UserInfo;

import java.util.List;

/**
 * <p>
 * 用户 服务类
 * </p>
 *
 * @author jrlc
 * @since 2024-08-12
 */
public interface UserService extends IService<User> {
    /**
     * 用户登录
     * @param userAccount
     * @param userPassword
     * @return
     */
    UserLoginVO userLogin(String userAccount, String userPassword);

    /**
     * 用户注册
     * @param userAccount
     * @param userPassword
     * @param role
     * @return
     */
    long userRegister(String userAccount, String userPassword, String role);

    /**
     * 用户注销
     */

    void logout();

    /**
     * 微信登录
     * @param userInfo
     * @return
     */

    UserLoginVO userLoginByMpOpen(WxOAuth2UserInfo userInfo);

    /**
     *  获取用户vo
     * @param user
     * @return
     */

    UserVO getUserVO(User user);
    /**
     * 获取脱敏的用户信息
     *
     * @param userList
     * @return
     */
    List<UserVO> getUserVO(List<User> userList);

    /**
     * 获取分页查询条件
     * @param userQueryRequest
     * @return
     */

    QueryWrapper<User> getQueryWrapper(UserQueryRequest userQueryRequest);

    /**
     * 获取登陆用户vo
     * @param user
     * @return
     */
    UserLoginVO getLoginUserVO(User user);

}
